﻿using System;
using System.Security.Permissions;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Utilities;
using Microsoft.SharePoint.Workflow;
using System.Linq;

namespace NIH.SharePoint.Branding.BrandingWebEventReceiver
{
    /// <summary>
    /// Web Events
    /// </summary>
    public class BrandingWebEventReceiver : SPWebEventReceiver
    {
        public override void WebProvisioned(SPWebEventProperties properties)
        {
            SPWeb childSite = properties.Web;
            SPWeb topSite = childSite.Site.RootWeb;
            try
            {
                childSite.Features.Add(new Guid("0f486454-f97e-4273-9f46-e8b20e431b7a"));
                childSite.Update();
            }
            catch (Exception ex)
            {
                //throw new Exception(ex.Message);
            }
        }
    }
}